Simulink® from The MathWorks, Inc. of Natick, Mass., provides tools for modeling and simulating a variety of dynamic systems in one integrated, graphical environment. Simulink® enables users to design a block diagram for a target system, simulate the behavior of the system, analyze the performance of the system, and refine the design of the system. A block defines a dynamic system within a block diagram. The relationships between each elementary dynamic system in a block diagram are illustrated by the use of signals connecting the blocks. Collectively the blocks and lines in a block diagram describe an overall dynamic system.
Simulink® allows users to design target systems through a user interface that allows drafting of block diagrams of the target systems. All of the blocks in a block library provided by Simulink® and other programs are available to users when the users are building the block diagram of the target systems. Individual users may be able to customize this set of available blocks to: (a) reorganize blocks in some custom format; (b) delete blocks they do not use; and (c) add custom blocks they have designed. The blocks may be dragged through some human-machine interface (such as a mouse or keyboard) from the block library on to the window (i.e., model canvas). Simulink® also allows users to simulate the designed target systems to determine the behavior of the systems.
FIG. 1 shows an example of a Simulink® model. The Simulink® model contains blocks and arrows that connect the blocks. Each arrow connecting one block to another block represents a signal having a value. In the model shown in FIG. 1, input Signal 100 generates an input signal and sends the signal to a Sum block 102 via link 110. Link 114 communicates the value of the continuous-time state of the Integrator block 104 as a signal from the Integrator block 104 to a Scope block 108 for display, and also sends the signal to a Gain block 106 through link 116. Gain block 106 performs calculation on the input signal from link 116 and outputs the result through link 116 to the Sum block 102. The Sum block 102 adds the signal from link 110 and the signal from link 118 and outputs the result through link 112 to the Integrator block 104. The Integrator block 104 takes the signal from link 112 and performs integration on the value forwarded by the signal to produce an updated output on link 114 at a new point in time. The model continues on indefinitely or until a predetermined condition is achieved, a time period is attained, the user interrupts the execution, or any other termination condition is met.
Stateflow® from The MathWorks, Inc. of Natick, Mass., provides a state-based and flow diagram environment. Stateflow® provides a graphical environment for modeling and designing event-driven systems. Stateflow® describes complex system behavior using finite state machine theory, flow diagram notations, and state-transition diagrams. Stateflow® models state diagrams that graphically represent hierarchical and parallel states and the event-driven transitions between the states of the systems. Stateflow® is integrated with Simulink®, which enables each of the state diagrams to be represented as its own block. Based on the state diagrams created in Stateflow®, Simulink® executes the systems to analyze the behavior of the systems.
An example of a state diagram model created using Stateflow® is shown in FIG. 2A. Each arrow in the Stateflow® models represents a transition, which is a graphical object that, in most cases, links one object to another. One end of a transition is attached to a source object and the other end to a destination object. The source is where the transition begins and the destination is where the transition ends. A transition label describes the circumstances under which the system moves from one state to another. It is always the occurrence of some event that causes a transition to take place. The exemplar Stateflow® diagram as shown in FIG. 2A is embedded in a Simulink® environment. The Simulink® signals are provided to Stateflow®, and Stateflow® uses this information to decide whether there are changes in states.
Within the Stateflow® diagram of FIG. 2A, there are two states: an on state 120 and an off state 122. The default transition 126 determines the initial state is the off state 122. When an on_switch transition 130 is enabled, the enable signal passes to junction 124 and determines whether the temp 158 data is greater or equal to 30, if not, then the enable signal is passed on to signal link 132 and further finish the transition to the on state 120. Now the on state 120 is active and off state 122 inactive. The off state 122 will become active again when the off_switch signal 128 is enabled, at which time the on state 120 will become inactive.
When a user is viewing a state diagram, it is often difficult to determine function-call connectivity and components of the related Simulink® subsystem. For example, when editing a state diagram it can be difficult to determine which element of the block diagram environment the Stateflow® state variable is related to. To illustrate further, FIG. 2B shows a Stateflow® diagram and FIG. 2C depicts a related Simulink® model. When a user is editing the Stateflow® diagram of FIG. 2B, the user may not know or may have forgotten that the call 260 to CALC_TH is related to the Threshold_Calculation 270 subsystem of FIG. 2C. The difficulty in determining this function-call connectivity can result in decreases in modeling efficiency.
Therefore, a need exists for a system, method, and computer implemented product that uses an active link in a state programming environment to locate an element in a graphical programming environment.